home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / alib / csup / exec_support / CreateStdIO.c < prev    next >
C/C++ Source or Header  |  1994-02-15  |  2KB  |  80 lines

  1. /***********************************************************************
  2. *
  3. *    Exec Support Functions -- Standard IO Requests
  4. *
  5. ***********************************************************************/
  6.  
  7. #include "exec/types.h"
  8. #include "exec/ports.h"
  9. #include "exec/io.h"
  10.  
  11. extern struct IORequest *CreateExtIO(struct MsgPort *, ULONG);
  12. extern VOID DeleteExtIO(struct IORequest *);
  13.  
  14. /*
  15. ******* amiga.lib/CreateStdIO ************************************************
  16. *
  17. *   NAME
  18. *    CreateStdIO -- create an IOStdReq structure
  19. *
  20. *   SYNOPSIS
  21. *    ioReq = CreateStdIO(port);
  22. *
  23. *    struct IOStdReq *CreateStdIO(struct MsgPort *)
  24. *
  25. *   FUNCTION
  26. *    Allocates memory for and initializes a new IOStdReq structure.
  27. *
  28. *   INPUTS
  29. *    port - an already initialized message port to be used for this IO
  30. *           request's reply port. If this is NULL this function fails.
  31. *
  32. *   RESULT
  33. *    ioReq - a new IOStdReq structure, or NULL if there was not enough
  34. *        memory
  35. *
  36. *   SEE ALSO
  37. *    DeleteStdIO(), CreateExtIO(), exec.library/CreateIORequest()
  38. *
  39. ******************************************************************************
  40. */
  41.  
  42. struct IOStdReq *
  43. CreateStdIO( ioReplyPort )
  44.     struct MsgPort *ioReplyPort;
  45. {
  46.     return( (struct IOStdReq *)
  47.     CreateExtIO( ioReplyPort, sizeof( struct IOStdReq ) ) );
  48. }
  49.  
  50.  
  51. /*
  52. ******* amiga.lib/DeleteStdIO ************************************************
  53. *
  54. *   NAME
  55. *    DeleteStdIO - return memory allocated for IOStdReq
  56. *
  57. *   SYNOPSIS
  58. *    DeleteStdIO(ioReq);
  59. *
  60. *    VOID DeleteStdIO(struct IOStdReq *);
  61. *
  62. *   FUNCTION
  63. *    Frees up an IOStdReq as allocated by CreateStdIO().
  64. *
  65. *   INPUTS
  66. *    ioReq - the IORequest block to be freed, or NULL.
  67. *
  68. *   SEE ALSO
  69. *    CreateStdIO(), DeleteExtIO(), exec.library/CreateIORequest()
  70. *
  71. ******************************************************************************
  72. */
  73.  
  74. DeleteStdIO( ioStdReq )
  75.     struct IOStdReq *ioStdReq;
  76. {
  77.     DeleteExtIO( (struct IORequest *)ioStdReq );
  78.     return 0;
  79. }
  80.